﻿namespace Blaze.Framework.Pooling
{
    using UnityEngine;

    /// <summary>
    /// 用于标记由对象池管理的对象状态。
    /// </summary>
    public class PoolObject : MonoBehaviour
    {
        /// <summary>
        /// 是否正在池中。
        /// </summary>
        public bool IsPooled;

        /// <summary>
        /// 所属的对象池的唯一编号。
        /// </summary>
        public int PoolId;

        /// <summary>
        /// 获取缓存的<see cref="Transform"/>组件。
        /// </summary>
        public Transform Transform
        {
            get
            {
                if (mTransform == null)
                    mTransform = transform;
                return mTransform;
            }
        }

        private Transform mTransform;
    }
}